import { createRouter, createWebHistory } from 'vue-router'


import UserLoginPage from '@/pages/user/UserLoginPage.vue'
import UserRegisterPage from '@/pages/user/UserRegisterPage.vue'
import UserManagePage from '@/pages/admin/UserManagePage.vue'
import UserEditPage from '@/pages/user/UserEditPage.vue'
import MdEditor from '@/components/MdEditor.vue'
import CodeEditor from '@/components/CodeEditor.vue'
import AddQuestionView from '@/pages/question/AddQuestionView.vue'
import ManageQuestionView from '@/pages/question/ManageQuestionView.vue'
import QuestionsView from '@/pages/question/QuestionsView.vue'
import ViewQuestionView from '@/pages/question/ViewQuestionView.vue'
import QuestionSubmitView from '@/pages/question/QuestionSubmitView.vue'
import test from '@/components/test.vue'
import UserQuestionSubmitView from '@/pages/question/UserQuestionSubmitView.vue'


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: '主页',
      component: QuestionsView,
    },
    {
      path: '/admin/add/question',
      name: '新增题目',
      component: AddQuestionView,
    },
    {
      path: '/admin/update/question',
      name: '修改题目',
      component: AddQuestionView,
    },
    {
      path: '/admin/manage/question/',
      name: '管理题目',
      component: ManageQuestionView,
    },
    {
      path: '/view/question/:id',
      name: '题目页面',
      component: ViewQuestionView,
      props: true,
    },
    {
      path: '/questions',
      name: '浏览题目',
      component: QuestionsView,
    },
    {
      path: '/question_submit',
      name: '浏览题目提交',
      component: QuestionSubmitView,
    },
    {
      path: '/user/login',
      name: '用户登录',
      component: UserLoginPage,
    },
    {
      path: '/user/register',
      name: '用户注册',
      component: UserRegisterPage,
    },
    {
      path: '/admin/userManage',
      name: '用户管理',
      component: UserManagePage,
    },

    {
      path: '/user/edit',
      name: '个人信息设置',
      component: UserEditPage,
    },
    {
      path: '/user_question_submit',
      name: '用户浏览题目提交',
      component: UserQuestionSubmitView,
    },
    {
      path: '/test',
      name: '测试',
      component: test,
    },


  ],

})

export default router
